import request from '@/utils/request'
import type { UseringoResponseData, CertationTypeResponseData, OrderResponseData } from '@/api/type.ts'

// 获取用户信息
export function reqUserInfo() {
    return request.get<any, UseringoResponseData>('/user/auth/getUserInfo')
}
// 获取证件类型
export function reqCertationType(CertificatesType = 'CertificatesType') {
    return request.get<any, CertationTypeResponseData>('/cmn/dict/findByDictCode/' + CertificatesType)
}
//完成实名认证
export function reqUserCertation(data: any) {
    return request.post('/user/auth/userAuah', data)
}

// 获取用户订单号的数据
export function reqUserOrderInfo(page: number, limit: number, patientId: string, orderStatus: string) {
    return request.get('/order/orderInfo/auth/' + `${page}/${limit}?patientId=${patientId}&orderStatus=${orderStatus}`)
}
// 获取某账号下就诊人的信息
export function reqGetUser() {
    return request.get('/user/patient/auth/findAll')
}
// 获取订单可能有的状态列表
export function reqOrderState() {
    return request.get('/order/orderInfo/auth/getStatusList')
}
// 获取某订单的详情
export function reqOrderInfo(orderId: string) {
    return request.get<any, OrderResponseData>('/order/orderInfo/auth/getOrderInfo/' + orderId)
}

// 取消预约
export function reqCancelOrder(id: string) {
    return request.get('/order/orderInfo/auth/cancelOrder/' + id)
}
// 获取支付二维码
export function reqQrcode(orderId: string) {
    return request.get('/order/weixin/createNative/' + orderId)
}
// 获取订单支付结果
export function reqQueryPayState(orderId: string) {
    return request.get('/order/weixin/queryPayStatus/' + orderId)
}
// 就诊人管理页面获取全部就诊人信息
export function reqAllUser() {
    return request.get('/user/patient/auth/findAll')
}
// 获取城市数据
export function reqCity(parentId: string) {
    return request.get('/cmn/dict/findByParentId/' + parentId)
}
// 新增就诊人
export function reqAddUser(data: any) {
    return request.post('/user/patient/auth/save', data)
}
// 修改就诊人信息
export function reqEditUser(data: any) {
    return request.put('/user/patient/auth/update', data)
}
// 删除就诊人
export function reqDeleteUser(id: number) {
    return request.delete('/user/patient/auth/remove/' + id)
}